import request from '@/utils/request';

export function querys(query){//获取库存数据
  return request({
    url: '/goods/query',
    method: 'get',
    params: query
  });
};
export function createdBy(query){//查询我的申请
  return request({
    url: '/apply/query/createdBy='+query,
    method: 'get',
    // params: query
  });
};
export function deltby(query){//删除申请
  return request({
    url: '/apply/delete/id'+query,
    method: 'get',
    // params: query
  });
};
export function create(item,query) {//发起物料申请||编辑物料申请
  let url = item==1?'/apply/edit':'/apply/create';
  return request({
    url:url,
    method: 'post',
    data: query
  });
};

export function createdBys(item,query,dat) {//查询我的 0物料申请记录 || 1采购申请记录
  let url = item==0?'/apply/query/createdBy/':'/purchase/query/createdBy/';
  return request({
    url:url+query,
    method: 'get',
    params: dat
  });
};


export function purchasecreate(item,query) {//发起采购申请
  return request({
    url:'/purchase/create',
    method: 'post',
    data: query
  });
};

// export function applyIn(query){//入库申请
//   return request({
//     url: '/purchase/applyIn/id='+query,
//     method: 'get',
//   });
// };

